package com.zgjkhis.modules.charges.service.impl;

import com.github.pagehelper.PageInfo;
import com.zgjkhis.common.service.impl.BaseServiceImpl;
import com.zgjkhis.domain.PageResult;
import com.zgjkhis.modules.charges.domain.Invoice;
import com.zgjkhis.modules.charges.service.InvoiceService;
import com.zgjkhis.modules.charges.service.dto.InvoiceQueryCriteria;
import com.zgjkhis.modules.charges.service.mapper.InvoiceMapper;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

// 默认不使用缓存
//import org.springframework.cache.annotation.CacheConfig;
//import org.springframework.cache.annotation.CacheEvict;
//import org.springframework.cache.annotation.Cacheable;

/**
 * @Author yzq
 * @Description 发票打印
 * @Date 2021/6/23 9:47
 * @Param
 * @return
 **/
@Service
//@CacheConfig(cacheNames = "user")
public class InvoiceServiceImpl extends BaseServiceImpl<InvoiceMapper, Invoice> implements InvoiceService {

    @Override
    public PageResult<Invoice> findAllByPageable(InvoiceQueryCriteria criteria, Pageable pageable) {
        getPage(pageable);
        PageInfo<Invoice> page = new PageInfo<>(this.baseMapper.findAllByPageable(criteria));
        return PageResult.data(page);
    }
}
